package com.job.Gai_Yian.Homework0711;

/**
 * @author Gai_Yian
 * @version 1.0
 * @since 2022-07-12 12:13:24
 */
public class Premier1 {
    //单例模式·懒汉式
    public static int number=1000;
    private String name;
    private static Premier1 primier;//2.自己创建一个对象

    public static Premier1 getInstance(){            //3.设置公共访问方法
        if (primier==null){
            primier=new Premier1();
        }
        return primier;
    }

    private Premier1(){                  //1.私有化构造
    }

    private Premier1(String name){
        this.name=name;
    }

    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name=name;
    }
}
